1. Field of the Invention
The present invention relates to an apparatus that performs an interpolation process in order to interpolate a pixel value for a pixel having a missing pixel value or an incorrect pixel value in an image, and a pixel interpolation method performed by the apparatus.
2. Description of the Related Art
A scanner device that scans an image using an optical unit is classified into an apparatus that employs a contact image sensor (CIS) and an apparatus that employs a charge coupled device (CCD). The apparatus employing the CIS is unable to scan a stereoscopic document since the document needs to be in close contact with a surface to be scanned. However, in recent years, the device employing the CIS has been in widespread use due to its thin body and an inexpensive cost as compared to the device employing the CCD as well as an improvement in the technique of reducing noise that is likely to occur in a scanned image. For example, the CIS is used in an image scanning device having a one-pass duplex scanning function in order to scan the rear surface of a document.
The CIS uses RGB light emitting diodes (LEDs) as a light source, emits R, G, and B color lights to a document by switching them at a high speed to input the lights reflected from the document to an imaging element (CMOS image sensor) through a lens, converts the input lights from the document into voltage values pixel by pixel using the CMOS image sensor, and outputs the converted voltage values.
The scanner device employing the CIS employs a contact image sensor method of bringing a document into close contact with a sensor using a roller and scanning the document line by line. Since it is difficult to manufacture one lengthy sensor, the CIS has a configuration in which a plurality of short sensors are arranged in the length direction thereof to form a scanning unit. Thus, a certain gap is formed between the sensors, and it may not be possible to acquire an image signal in this gap. As a result, a deficiency in the image signal occurs.
Such a problem is not limited to the device employing the CIS. In a scanner device, the image signal may become deficient or the scanned image signal may have an incorrect value due to a defect of a sensor scanning the image signal or the presence of an obstacle in the midway of an optical path such as dust present on a contact glass on which a document is set.
As a result, there is a problem in that a pixel having a missing pixel value or an incorrect pixel value is present in a scanned image, and the image quality deteriorates. To solve this problem, in the related art, there is known a method of estimating a correct pixel value of a target pixel having a missing or incorrect pixel value from pixel values of the surrounding pixels thereof and interpolating (inserting) the estimated pixel value instead of the missing or incorrect pixel value of the target pixel.
For example, a method of performing linear interpolation using the pixel values of the surrounding pixels of a target pixel; and a method of performing polynomial interpolation or spline interpolation using a function of the second order or higher are known. The interpolation method based on linear interpolation is ideal for interpolation at portions of an image having a small change in density but is not ideal for interpolation at portions of an image having a severe change in density like a halftone dot region.
The interpolating method based on polynomial interpolation and spline interpolation can estimate pixel values with high accuracy when the sampling cycle for sampling an image such as a digital photograph is sufficiently shorter than the variation cycle of the image pattern. However, in the case of halftone dot images, since the image resolution is not sufficient as compared to the screen frequency of halftone dots, the sampling period is not sufficient in relation to the variation period of the image. Thus, the interpolating method may be unable to reproduce the original pattern correctly.
Thus, in order to solve the problem of the interpolating method, a method which uses pattern matching has been proposed. In this pattern matching method, it is possible to reproduce high-frequency components which could not be reproduced by the interpolating method using similar patterns at the position in the vicinity of the interpolation target pixel.
However, in general, since the pattern matching uses a large range of information as compared to the interpolating method, although the optimum solution to a base pattern is obtained, the obtained solution is not said to be optimum to the interpolation target pixel. This problem happens because when searching for similar patterns in the pattern matching method, patterns which are slightly different from each other as a whole are not distinguished from patterns which are mostly identical but partly greatly different from each other.
In particular, like a halftone dot region having a high screen ruling, when information is eccentrically distributed to specific pixels, a method of selecting similar patterns has a large effect on the interpolation result. Moreover, in a halftone dot region having a low density, since the proportion of pixels belonging to the background region of an image is relatively high, similar patterns may be detected in the background region rather than the halftone dot region, or alternatively, no similar pattern may be detected.
Therefore, when performing interpolation, it is necessary to use an interpolation method depending on the characteristics of a region to which the interpolation target pixel belongs. In order to accurately estimate the pixel value of the interpolation target pixel, there has been proposed a device in which when the position of an interpolation target pixel is within a halftone dot region, patterns similar to a pattern including the interpolation target pixel are searched for from an image, and the pixel value of a pixel, which is included in the most similar pattern and corresponds to the interpolation target pixel, is determined as the pixel value of the interpolation target pixel (see Japanese Patent No. 4330164).
This device determines whether the position of an interpolation target pixel corresponding to a connecting portion of contact image sensors is within a halftone dot region or a non-halftone dot region based on the image data scanned by an image scanning sensor. When the position of the interpolation target pixel is within the non-halftone dot region, the pixel data of the interpolation target pixel are generated by means of linear interpolation, and the generated pixel data is inserted into the interpolation target pixel. On the other hand, when the position of the interpolation target pixel is within the halftone dot region, the pixel data of the interpolation target pixel are generated by means of pattern matching, and the generated pixel data is inserted into the interpolation target pixel.
In this case, one base block including the interpolation target pixel and a plurality of reference blocks having the same size as the base block but not including the interpolation target pixel are set in an image region near the position of the interpolation target pixel. Then, the correlation values between the base block and the respective reference blocks are calculated based on the pixel data within the base block and the pixel data within the respective reference blocks. Among the pixel data within a reference block having the highest correlation value with the base block, the pixel data of a pixel corresponding to the interpolation target pixel within the base block are determined as the pixel data of the interpolation target pixel.
However, in this interpolation method, although high interpolation accuracy can be obtained for images in which the pixel values change smoothly, there is a problem in that the interpolation accuracy decreases for images in which the pixel values change abruptly.
Halftone dots used for color images are generally made up of dots of the three colors of C, M, and Y (cyan, magenta, and yellow) or the four colors of C, M, Y, and K. Thus, in order to perform accurate interpolation, it is necessary to reproduce dots of the individual colors. However, in the related art, a method of reproducing halftone dots of individual colors is not known.
Therefore, there is a demand for a device and a method capable of performing an interpolation process with high accuracy with respect to images of which the pixel values change abruptly and reproducing halftone dots of individual colors in a color image.